-
Notifications
You must be signed in to change notification settings - Fork 615
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Raise error if broadcasting with MottonenStatePreparation
and BasisStatePreparation
compute_decomposition
#4767
Conversation
[sc-48950] |
MottonenStatePreparation.compute_decomposition
MottonenStatePreparation
and BasisStatePreparation
compute_decomposition
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4767 +/- ##
==========================================
- Coverage 99.64% 99.63% -0.02%
==========================================
Files 381 381
Lines 34336 34121 -215
==========================================
- Hits 34214 33996 -218
- Misses 122 125 +3
☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
broadcast_expand
does not fix the problem.
The problem is that op.batch_size
will still be None
, so broadcast_expand
will not register that the template has a batched.
broadcast_expand
does work if we set ndim_params = (1,)
for MottonenStatePrep
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Context:
MottonenStatePreparation
andBasisStatePreparation
fails right now when decomposing a broadcasted state vector because different state vectors have different decompositions.Description of the Change:
MottonenStatePreparation.compute_decomposition
andBasisStatePreparation.compute_decomposition
if thebatch_size
if notNone
and suggest users to usebroadcast_expand
.Benefits:
No failures or wrong results when decomposing Mottonen or BasisState
Possible Drawbacks:
Related GitHub Issues:
#4753